(function () {
  'use strict';

  angular.module('BlurAdmin')
    .controller('UploadImgModalCtrl', UploadImgModalCtrl);

  /** @ngInject */
  function UploadImgModalCtrl($scope, $uibModalInstance, alertService) {
    $scope.formData = {};
    $scope.key = 'hm/richText/';

    $scope.ok = function () {
      if ($scope.validation()) {
        $uibModalInstance.close($scope.formData.currImg);
      }
    };

    $scope.cancel = function () {
      $uibModalInstance.dismiss('cancel');
    };

    $scope.validation = function () {
      if (!$scope.formData.currImg) {alertService.warning('请上传图片。'); return false;}

      return true
    }



  }

})();
